package com.example.demo.service;

import com.example.demo.domain.Order;
import com.example.demo.domain.OrderExample;
import com.example.demo.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.thymeleaf.standard.expression.OrExpression;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> findOrder() {
        return orderMapper.selectByExample(new OrderExample());
    }

    @Override
    public void saveOrder(Order order){
        orderMapper.insert(order);
    }

    @Override
    public List<Order> selectByStatus(String status){
        return orderMapper.selectByStatus(status);
    }

    @Override
    public Order selectByPrimaryKey(String orderID){
        Order order=orderMapper.selectByPrimaryKey(orderID);
        return order;
    }
}
